//
//  GoogleSpreadsheet.h
//  itaka
//
//  Created by Robert Soszynski on 1/14/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GData.h"

@protocol GoogleSpreadsheetDelegate <NSObject>
@required
- (void) spreadsheetInitCompleted;
- (void) spreadsheetError:(NSString*) error;
@end

@interface GoogleSpreadsheet : NSObject {
    id <GoogleSpreadsheetDelegate> delegate;
    
    GDataServiceGoogleSpreadsheet* service;
    
    GDataEntrySpreadsheet *spreadsheet;
    GDataEntryWorksheet *worksheet;
    GDataEntrySpreadsheetList *record;
    
    NSString *spreadsheetIdentifier;
    NSString *worksheetIdentifier;
    NSString *recordIdentifier;
}

@property (retain, nonatomic) id <GoogleSpreadsheetDelegate> delegate;
@property (retain, nonatomic) GDataEntrySpreadsheet* spreadsheet;
@property (retain, nonatomic) GDataEntryWorksheet *worksheet;
@property (retain, nonatomic) GDataEntrySpreadsheetList *record;
@property (retain, nonatomic) NSString *spreadsheetIdentifier, *worksheetIdentifier, *recordIdentifier;

- (void) setCredentials:(NSString*) username: (NSString*) password;

- (void) startProceeding:(NSString*) spreadsheet: (NSString*) worksheet: (NSString*) record;

- (void) pickSpreadsheet: (NSString*) identifier;
- (void) pickWorksheet: (NSString*) identifier;
- (void) pickRecord: (NSString*) identifier;

- (void) setCellValue:(NSString*) key: (NSString*) value;

- (void) updateRecord;
- (void) addRecord;

- (void) delegateError: (NSError*) err;

@end
